package org.myspringframework.test;

import cn.powernode.Spring6Config;
import cn.powernode.service.StudentService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class SpringTest2 {
    @Test
    public void test() {
        ApplicationContext context = new ClassPathXmlApplicationContext("spring3.xml");
        StudentService studentService = context.getBean("studentService", StudentService.class);
        studentService.deletedById(1);
    }

    @Test
    public void testNoXml(){
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(Spring6Config.class);
        StudentService studentService = context.getBean("studentService", StudentService.class);
        studentService.deletedById(1);
    }
}
